<template>
  <div id="home">
    <Header :is_login="is_login" @logout="logout" :current_page="current_page"/>
    <Banner/>
    <Footer/>
  </div>
</template>

<script>
  import Header from './common/Header'
  import Banner from './common/Banner'
  import Footer from './common/Footer'

  export default {
    name: "Home",
    data() {
      return {
        id:sessionStorage.id||localStorage.id,
        username:sessionStorage.username||localStorage.username,
        token:sessionStorage.token||localStorage.token,
        current_page:0,
        is_login:false,
      }
    },
    components: {
      Header,
      Banner,
      Footer,
    },
    mounted(){
      if(this.id&&this.token){
        this.is_login=true;
      }
    },
    methods:{
      logout(){
        this.is_login=false;
      }
    }
  }
</script>

<style scoped>

</style>
